package cfca.seal.mananger;

import cfca.seal.bean.AdminUser;
import cfca.seal.bean.OperationLog;
import cfca.seal.web.system.SessionManager;
import javax.servlet.http.HttpServletRequest;

public class OperationLogManager
{
  public static OperationLog getInstance(HttpServletRequest request, String applicationName, String type, String objectId, String description, String fileName)
  {
    OperationLog log = new OperationLog();

    log.setApplicationName(applicationName);
    log.setType(type);
    log.setObjectId(objectId);
    log.setOperator(SessionManager.getManager(request).getId());
    log.setDescription(description);
    log.setFileName(fileName);
    log.setResult(20);

    return log;
  }

  public static OperationLog getInstance(String type, String description) {
    OperationLog log = new OperationLog();

    log.setApplicationName("接口");
    log.setType(type);
    log.setObjectId("");
    log.setOperator("");
    log.setDescription(description);
    log.setResult(20);

    return log;
  }

  public static OperationLog getInstance(String operator, String applicationName, String type, String objectId, String description, String fileName) {
    OperationLog log = new OperationLog();

    log.setApplicationName(applicationName);
    log.setType(type);
    log.setObjectId(objectId);
    log.setOperator(operator);
    log.setDescription(description);
    log.setFileName(fileName);
    log.setResult(20);

    return log;
  }
}